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
6d331ca9
Kaydet (Commit)
6d331ca9
authored
Kas 01, 2007
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Undo revision 58533 58534 fixes. Those were a workaround for
a problem introduced by 58385.
üst
aae141a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
dbtables.py
Lib/bsddb/dbtables.py
+2
-3
No files found.
Lib/bsddb/dbtables.py
Dosyayı görüntüle @
6d331ca9
...
@@ -360,12 +360,11 @@ class bsdTableDB :
...
@@ -360,12 +360,11 @@ class bsdTableDB :
unique
=
0
unique
=
0
while
not
unique
:
while
not
unique
:
# Generate a random 64-bit row ID string
# Generate a random 64-bit row ID string
# (note:
this code has <64 bits of
randomness
# (note:
might have <64 bits of true
randomness
# but it's plenty for our database id needs!)
# but it's plenty for our database id needs!)
# We must ensure that no null bytes are in the id value.
blist
=
[]
blist
=
[]
for
x
in
xrange
(
_rowid_str_len
):
for
x
in
xrange
(
_rowid_str_len
):
blist
.
append
(
random
.
randint
(
1
,
255
))
blist
.
append
(
random
.
randint
(
0
,
255
))
newid
=
struct
.
pack
(
'B'
*
_rowid_str_len
,
*
blist
)
newid
=
struct
.
pack
(
'B'
*
_rowid_str_len
,
*
blist
)
# Guarantee uniqueness by adding this key to the database
# Guarantee uniqueness by adding this key to the database
...
...
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