| 123456789101112131415161718 |
- //
- // UInt64Extension.swift
- // CryptoSwift
- //
- // Created by Marcin Krzyzanowski on 02/09/14.
- // Copyright (c) 2014 Marcin Krzyzanowski. All rights reserved.
- //
- /** array of bytes */
- extension UInt64 {
- init<T: Collection>(bytes: T) where T.Iterator.Element == UInt8, T.Index == Int {
- self = bytes.toInteger()
- }
- func bytes(totalBytes: Int = MemoryLayout<UInt64>.size) -> Array<UInt8> {
- return arrayOfBytes(value: self, length: totalBytes)
- }
- }
|