Fixed ObjectID.from_string bug.

This commit is contained in:
Jim Menard 2009-01-12 09:58:13 -05:00
parent 80dd421dd9
commit 3dd465ddec
1 changed files with 3 additions and 1 deletions

View File

@ -57,10 +57,12 @@ module XGen
# with that value.
def self.from_string(str)
data = []
byte = 0
i = str.to_i(16)
while i > 0
while byte < 12
data << (i & 0xff)
i >>= 8
byte += 1
end
self.new(data.reverse)
end