Reader small image

You're reading from  Learn Data Structures and Algorithms with Golang

Product typeBook
Published inMar 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789618501
Edition1st Edition
Languages
Right arrow
Author (1)
Bhagvan Kommadi
Bhagvan Kommadi
author image
Bhagvan Kommadi

Bhagvan Kommadi, Founder, Architect Corner has around 18 years experience in the industry ranging from large-scale enterprise development to incubating software product startups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is currently working as CTO of Crystal Delta Solutions. He is the member of IFX forum and an Individual member of Oracle JCP. He has developed Go language based blockchain solutions in retail, education, banking, and financial services sectors. These blockchain solutions were based on Chain Core (Go language based), Ethereum and Hyperledger blockchain platforms. He has experience in building high transactional applications using Java, C, C++, C#, Python, Go, Ruby and JavaScript frameworks. He has reviewed books such as Beyond Software Architecture-Creating and sustaining winning solutions by Luke Hohmann and Algorithms of the intelligent Web by Dr. Haralambos (Babis) Marmanis.
Read more about Bhagvan Kommadi

Right arrow

The hash functions

Hash functions are used in cryptography and other areas. These data structures are presented with code examples related to cryptography. There are two ways to implement a hash function in Go: with crc32 or sha256. Marshaling (changing the string to an encoded form) saves the internal state, which is used for other purposes later. A BinaryMarshaler (converting the string into binary form) example is explained in this section:

//main package has examples shown
// in Hands-On Data Structures and algorithms with Go book
package main
// importing bytes, crpto/sha256, encoding, fmt and log package
import (
"bytes"
"crypto/sha256"
"encoding"
"fmt"
"log"
"hash"
)

The main method creates a binary marshaled hash of two example strings. The hashes of the two strings are printed. The sum of the first hash is compared...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learn Data Structures and Algorithms with Golang
Published in: Mar 2019Publisher: PacktISBN-13: 9781789618501

Author (1)

author image
Bhagvan Kommadi

Bhagvan Kommadi, Founder, Architect Corner has around 18 years experience in the industry ranging from large-scale enterprise development to incubating software product startups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is currently working as CTO of Crystal Delta Solutions. He is the member of IFX forum and an Individual member of Oracle JCP. He has developed Go language based blockchain solutions in retail, education, banking, and financial services sectors. These blockchain solutions were based on Chain Core (Go language based), Ethereum and Hyperledger blockchain platforms. He has experience in building high transactional applications using Java, C, C++, C#, Python, Go, Ruby and JavaScript frameworks. He has reviewed books such as Beyond Software Architecture-Creating and sustaining winning solutions by Luke Hohmann and Algorithms of the intelligent Web by Dr. Haralambos (Babis) Marmanis.
Read more about Bhagvan Kommadi