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
aecc08ac
Kaydet (Commit)
aecc08ac
authored
Eyl 23, 2017
tarafından
Dmitry Chestnykh
Kaydeden (comit)
Benjamin Peterson
Eyl 23, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Docs: correct hashlib.blake2 keyed hashing example (bpo-31560)
üst
c8a6e5b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
hashlib.rst
Doc/library/hashlib.rst
+9
-5
susp-ignored.csv
Doc/tools/susp-ignored.csv
+0
-3
No files found.
Doc/library/hashlib.rst
Dosyayı görüntüle @
aecc08ac
...
...
@@ -510,15 +510,19 @@ to users and later verify them to make sure they weren't tampered with::
... h.update(cookie)
... return h.hexdigest().encode('utf-8')
>>>
>>> cookie = b'user:vatrogasac'
>>> def verify(cookie, sig):
... good_sig = sign(cookie)
... return compare_digest(good_sig, sig)
>>>
>>> cookie = b'user-alice'
>>> sig = sign(cookie)
>>> print("{0},{1}".format(cookie.decode('utf-8'), sig))
user
:vatrogasac,349cf904533767ed2d755279a8df84d0
>>>
compare_digest
(cookie, sig)
user
-alice,b'43b3c982cf697e0c5ab22172d1ca7421'
>>>
verify
(cookie, sig)
True
>>>
compare_digest(b'user:policajac
', sig)
>>>
verify(b'user-bob
', sig)
False
>>>
compare_digest
(cookie, b'0102030405060708090a0b0c0d0e0f00')
>>>
verify
(cookie, b'0102030405060708090a0b0c0d0e0f00')
False
Even though there's a native keyed hashing mode, BLAKE2 can, of course, be used
...
...
Doc/tools/susp-ignored.csv
Dosyayı görüntüle @
aecc08ac
...
...
@@ -130,9 +130,6 @@ library/exceptions,,:err,err.object[err.start:err.end]
library/functions,,:step,a[start:stop:step]
library/functions,,:stop,"a[start:stop, i]"
library/functions,,:stop,a[start:stop:step]
library/hashlib,,:vatrogasac,>>> cookie = b'user:vatrogasac'
library/hashlib,,:vatrogasac,"user:vatrogasac,349cf904533767ed2d755279a8df84d0"
library/hashlib,,:policajac,">>> compare_digest(b'user:policajac', sig)"
library/hashlib,,:LEAF,"h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,"
library/http.client,,:port,host:port
library/http.cookies,,`,!#$%&'*+-.^_`|~:
...
...
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