Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
daisuke-t-jp committed Feb 27, 2019
1 parent 1fac764 commit f890986
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,83 +68,83 @@ import FNV
## FNV-0
``` swift
/**
* 32bit hash
* 32bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv0_32(Array("string".utf8))
let digest = FNV.fnv0_32(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv0_32("string")
let digest = FNV.fnv0_32("string")

// Generate from Data.
let hash = FNV.fnv0_32("string".data(using: .utf8)!)
let digest = FNV.fnv0_32("string".data(using: .utf8)!)


/**
* 64bit hash
* 64bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv0_64(Array("string".utf8))
let digest = FNV.fnv0_64(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv0_64("string")
let digest = FNV.fnv0_64("string")

// Generate from Data.
let hash = FNV.fnv0_64("string".data(using: .utf8)!)
let digest = FNV.fnv0_64("string".data(using: .utf8)!)
```

## FNV-1
``` swift
/**
* 32bit hash
* 32bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv1_32(Array("string".utf8))
let digest = FNV.fnv1_32(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv1_32("string")
let digest = FNV.fnv1_32("string")

// Generate from Data.
let hash = FNV.fnv1_32("string".data(using: .utf8)!)
let digest = FNV.fnv1_32("string".data(using: .utf8)!)


/**
* 64bit hash
* 64bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv1_64(Array("string".utf8))
let digest = FNV.fnv1_64(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv1_64("string")
let digest = FNV.fnv1_64("string")

// Generate from Data.
let hash = FNV.fnv1_64("string".data(using: .utf8)!)
let digest = FNV.fnv1_64("string".data(using: .utf8)!)
```

## FNV-1a
``` swift
/**
* 32bit hash
* 32bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv1a_32(Array("string".utf8))
let digest = FNV.fnv1a_32(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv1a_32("string")
let digest = FNV.fnv1a_32("string")

// Generate from Data.
let hash = FNV.fnv1a_32("string".data(using: .utf8)!)
let digest = FNV.fnv1a_32("string".data(using: .utf8)!)


/**
* 64bit hash
* 64bit digest
*/
// Generate from [UInt8].
let hash = FNV.fnv1a_64(Array("string".utf8))
let digest = FNV.fnv1a_64(Array("string".utf8))

// Generate from String.
let hash = FNV.fnv1a_64("string")
let digest = FNV.fnv1a_64("string")

// Generate from Data.
let hash = FNV.fnv1a_64("string".data(using: .utf8)!)
let digest = FNV.fnv1a_64("string".data(using: .utf8)!)
```

0 comments on commit f890986

Please sign in to comment.