tiger

package module
v0.0.0-...-bde35e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2017 License: MIT Imports: 3 Imported by: 8

README

Tiger cryptographic hash function for Go


Build Status GoDoc

About Tiger

  • Tiger cryptographic hash function is designed by Ross Anderson and Eli Biham in 1995.
  • The size of a Tiger hash value is 192 bits. Truncated versions (Tiger/128, Tiger/160) are simply prefixes of Tiger/192.
  • Tiger2 is a variant where the message is padded by first appending a byte 0x80, rather than 0x01 as in the case of Tiger.
  • Links: paper, wikipedia

API Documentation

Implementing hash.Hash. Usage is pretty much the same as other stanard hashing libraries.
Documentation currently available at Godoc: http://godoc.org/github.com/cxmcc/tiger

Installing

go get github.com/cxmcc/tiger

Example

package main

import (
  "fmt"
  "io"
  "github.com/cxmcc/tiger"
)

func main() {
  h := tiger.New()
  io.WriteString(h, "Example for tiger")
  fmt.Printf("Output: %x\n", h.Sum(nil))
  // Output: 82bd060e19f945014f0063e8f0e6d7decfa9edfd97e76743
}

License

It's MIT License

Documentation

Overview

Package tiger implements the Tiger hash algorithm https://github.com/cxmcc/tiger

Index

Examples

Constants

View Source
const BlockSize = 64

The blocksize of Tiger hash function in bytes

View Source
const Size = 24

The size of a Tiger hash value in bytes

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New returns a new hash.Hash computing the Tiger hash value

Example
h := New()
io.WriteString(h, "It's the eye of the tiger, it's the thrill of the fight")
io.WriteString(h, "Rising up to the challenge of our rival!")
fmt.Printf("%x", h.Sum(nil))
Output:

a7bbad36cc17918e399ae8ee893e4595e4d24e1639fe822c

func New2

func New2() hash.Hash

New returns a new hash.Hash computing the Tiger2 hash value

Example
h := New2()
io.WriteString(h, "It's the eye of the tiger, it's the thrill of the fight")
io.WriteString(h, "Rising up to the challenge of our rival!")
fmt.Printf("%x", h.Sum(nil))
Output:

c86695c2a639506682de2c12c2d23b61a12db78ea1ee1001

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL