@@ -10,7 +10,7 @@ import .Base: *, +, -, /, <, <<, >>, >>>, <=, ==, >, >=, ^, (~), (&), (|), xor,
1010 sum, trailing_zeros, trailing_ones, count_ones, tryparse_internal,
1111 bin, oct, dec, hex, isequal, invmod, _prevpow2, _nextpow2, ndigits0zpb,
1212 widen, signed, unsafe_trunc, trunc, iszero, isone, big, flipsign, signbit,
13- sign, hastypemax, isodd, iseven, digits!
13+ sign, hastypemax, isodd, iseven, digits!, hash, hash_integer
1414
1515if Clong == Int32
1616 const ClongMax = Union{Int8, Int16, Int32}
769769
770770if Limb === UInt
771771 # this condition is true most (all?) of the time, and in this case we can define
772- # an optimized version of the above hash_integer(::Integer, ::UInt) method for BigInt
773- # used e.g. for Rational{BigInt}
772+ # an optimized version for BigInt of hash_integer (used e.g. for Rational{BigInt}),
773+ # and of hash
774+
775+ using . Base: hash_uint
776+
774777 function hash_integer (n:: BigInt , h:: UInt )
775778 GC. @preserve n begin
776779 s = n. size
@@ -800,7 +803,7 @@ if Limb === UInt
800803 limb <= typemin (Int) % UInt && return hash (- (limb % Int), h)
801804 end
802805 pow = trailing_zeros (x)
803- nd = ndigits0z (x, 2 )
806+ nd = Base . ndigits0z (x, 2 )
804807 idx = _divLimb (pow) + 1
805808 shift = _modLimb (pow) % UInt
806809 upshift = BITS_PER_LIMB - shift
0 commit comments