Skip to content

Commit f038cd1

Browse files
authored
Merge pull request #4 from ordo-one/pseudorandom-rawrepresentable
conform PseudoRandom to RawRepresentable
2 parents 6ae2115 + 84c97bb commit f038cd1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/Random/PseudoRandom.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
self.wyhash = .init(seed: seed)
66
}
77
}
8+
extension PseudoRandom: RawRepresentable {
9+
@inlinable public init(rawValue: UInt64) {
10+
self.wyhash = .init(rawValue: rawValue)
11+
}
12+
@inlinable public var rawValue: UInt64 {
13+
self.wyhash.rawValue
14+
}
15+
}
816
extension PseudoRandom {
917
@inlinable public var generator: Wyhash {
1018
get { self.wyhash }

0 commit comments

Comments
 (0)