mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-15 15:05:15 +03:00
27 lines
579 B
Swift
27 lines
579 B
Swift
//
|
|
// Hashable.swift
|
|
// BigInt
|
|
//
|
|
// Created by Károly Lőrentey on 2016-01-03.
|
|
// Copyright © 2016-2017 Károly Lőrentey.
|
|
//
|
|
|
|
extension BigUInt: Hashable {
|
|
//MARK: Hashing
|
|
|
|
/// Append this `BigUInt` to the specified hasher.
|
|
public func hash(into hasher: inout Hasher) {
|
|
for word in self.words {
|
|
hasher.combine(word)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension BigInt: Hashable {
|
|
/// Append this `BigInt` to the specified hasher.
|
|
public func hash(into hasher: inout Hasher) {
|
|
hasher.combine(sign)
|
|
hasher.combine(magnitude)
|
|
}
|
|
}
|