Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
75fec2c8
Kaydet (Commit)
75fec2c8
authored
Kas 02, 2001
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[Patch #476612] Add attributes from PEP247 to the md5 and sha modules
üst
a73f78b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
md5module.c
Modules/md5module.c
+7
-1
shamodule.c
Modules/shamodule.c
+4
-3
No files found.
Modules/md5module.c
Dosyayı görüntüle @
75fec2c8
...
@@ -161,6 +161,10 @@ static PyMethodDef md5_methods[] = {
...
@@ -161,6 +161,10 @@ static PyMethodDef md5_methods[] = {
static
PyObject
*
static
PyObject
*
md5_getattr
(
md5object
*
self
,
char
*
name
)
md5_getattr
(
md5object
*
self
,
char
*
name
)
{
{
if
(
strcmp
(
name
,
"digest_size"
)
==
0
)
{
return
PyInt_FromLong
(
16
);
}
return
Py_FindMethod
(
md5_methods
,
(
PyObject
*
)
self
,
name
);
return
Py_FindMethod
(
md5_methods
,
(
PyObject
*
)
self
,
name
);
}
}
...
@@ -264,11 +268,13 @@ static PyMethodDef md5_functions[] = {
...
@@ -264,11 +268,13 @@ static PyMethodDef md5_functions[] = {
DL_EXPORT
(
void
)
DL_EXPORT
(
void
)
initmd5
(
void
)
initmd5
(
void
)
{
{
PyObject
*
m
,
*
d
;
PyObject
*
m
,
*
d
,
*
i
;
MD5type
.
ob_type
=
&
PyType_Type
;
MD5type
.
ob_type
=
&
PyType_Type
;
m
=
Py_InitModule3
(
"md5"
,
md5_functions
,
module_doc
);
m
=
Py_InitModule3
(
"md5"
,
md5_functions
,
module_doc
);
d
=
PyModule_GetDict
(
m
);
d
=
PyModule_GetDict
(
m
);
PyDict_SetItemString
(
d
,
"MD5Type"
,
(
PyObject
*
)
&
MD5type
);
PyDict_SetItemString
(
d
,
"MD5Type"
,
(
PyObject
*
)
&
MD5type
);
if
(
(
i
=
PyInt_FromLong
(
16
))
!=
NULL
)
PyDict_SetItemString
(
d
,
"digest_size"
,
i
);
/* No need to check the error here, the caller will do that */
/* No need to check the error here, the caller will do that */
}
}
Modules/shamodule.c
Dosyayı görüntüle @
75fec2c8
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
/* See below for information about the original code this module was
/* See below for information about the original code this module was
based upon. Additional work performed by:
based upon. Additional work performed by:
Andrew Kuchling (a
mk1@bigfoot.com
)
Andrew Kuchling (a
kuchlin@mems-exchange.org
)
Greg Stein (gstein@lyra.org)
Greg Stein (gstein@lyra.org)
*/
*/
...
@@ -458,8 +458,8 @@ SHA_getattr(PyObject *self, char *name)
...
@@ -458,8 +458,8 @@ SHA_getattr(PyObject *self, char *name)
{
{
if
(
strcmp
(
name
,
"blocksize"
)
==
0
)
if
(
strcmp
(
name
,
"blocksize"
)
==
0
)
return
PyInt_FromLong
(
1
);
return
PyInt_FromLong
(
1
);
if
(
strcmp
(
name
,
"digestsize"
)
==
0
)
if
(
strcmp
(
name
,
"digest
_size"
)
==
0
||
strcmp
(
name
,
"digest
size"
)
==
0
)
return
PyInt_FromLong
(
20
);
return
PyInt_FromLong
(
20
);
return
Py_FindMethod
(
SHA_methods
,
self
,
name
);
return
Py_FindMethod
(
SHA_methods
,
self
,
name
);
}
}
...
@@ -542,4 +542,5 @@ initsha(void)
...
@@ -542,4 +542,5 @@ initsha(void)
functions require an integral number of
functions require an integral number of
blocks */
blocks */
insint
(
"digestsize"
,
20
);
insint
(
"digestsize"
,
20
);
insint
(
"digest_size"
,
20
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment