2020-02-03 06:02:28 +01:00
|
|
|
// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved.
|
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
module wyhash
|
|
|
|
|
|
|
|
pub fn rand_u64(seed &u64) u64 {
|
2020-03-05 23:27:21 +01:00
|
|
|
mut seed0 := seed
|
2020-02-03 06:02:28 +01:00
|
|
|
unsafe{
|
|
|
|
mut seed1 := *seed0
|
2020-04-23 11:19:04 +02:00
|
|
|
seed1 += (wyp0)
|
|
|
|
(*seed0) = seed1
|
2020-02-03 06:02:28 +01:00
|
|
|
return wymum(seed1^wyp1, seed1)
|
2020-04-23 11:19:04 +02:00
|
|
|
}
|
2020-03-05 23:27:21 +01:00
|
|
|
return 0
|
2020-02-03 06:02:28 +01:00
|
|
|
}
|