     }
 }
 
-public extension CSArrayType where Iterator.Element == UInt8 {
-    public func sha256() -> [Iterator.Element] {
+internal extension CSArrayType where Iterator.Element == UInt8 {
+    internal func sha256() -> [Iterator.Element] {
         return Digest.sha256(cs_arrayValue())
     }
 
-    public func sha512() -> [Iterator.Element] {
+    internal func sha512() -> [Iterator.Element] {
         return Digest.sha512(cs_arrayValue())
     }
 
-    public func authenticate<A: Authenticator>(with authenticator: A) throws -> [Iterator.Element] {
+    internal func authenticate<A: Authenticator>(with authenticator: A) throws -> [Iterator.Element] {
         return try authenticator.authenticate(cs_arrayValue())
     }
 }

        return UInt16(s)
    }

    public func sha256() -> Data? {
        let result = Digest.sha256(self.bytes)
        return Data(bytes: result)
    }

    public func sha512() -> Data? {
        let result = Digest.sha512(self.bytes)
        return Data(bytes: result)
    }

    public func authenticate(with authenticator: Authenticator) throws -> Data {
        let result = try authenticator.authenticate(self.bytes)
        return Data(bytes: result)
    }

//  Copyright © 2015 Marcin Krzyzanowski. All rights reserved.
//

internal protocol CSArrayType: Collection, RangeReplaceableCollection {
    func cs_arrayValue() -> [Iterator.Element]
}

extension Array: CSArrayType {
    internal func cs_arrayValue() -> [Iterator.Element] {
        return self
    }
}

internal extension CSArrayType where Iterator.Element == UInt8 {
    internal func toHexString() -> String {
        return self.lazy.reduce("") {
            var s = String($1, radix: 16)
            if s.characters.count == 1 {
