This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import library | |
import "golang.org/x/crypto/argon2" | |
// Function to generate argon2 | |
func generateArgon2(inputString string) string { | |
salt := []byte("12345678") | |
var iterators uint32 = 2 | |
var memory uint32 = 16 | |
var parallelism uint8 = 2 | |
var hashLen uint32 = 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import library to generate Argon2 | |
import de.mkammerer.argon2.Argon2; | |
import de.mkammerer.argon2.Argon2Factory; | |
import de.mkammerer.argon2.Argon2Factory.Argon2Types; | |
// Function to generaye Argon2 | |
public static String generateArgon2(String inputString) throws Exception { | |
int iterations = 2; | |
int mem = 16; | |
int parallelism = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import library | |
const argon2 = require('argon2-browser') | |
// Hash plaintext with argon2 | |
generateHash = (plaintext) => { | |
argon2.hash({ | |
pass: plainText, | |
salt: '12345678', | |
time: 2, | |
mem: 16, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import library | |
import "crypto/sha512" | |
// Function to generate SHA512 | |
func generateSHA512(inputString string) string { | |
bData := []byte(inputString) | |
bHex := sha512.Sum512(bData) | |
strHex := hex.EncodeToString(bHex[:]) | |
return strHex | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import Apache Codec Common | |
import org.apache.commons.codec.digest.DigestUtils; | |
// Function to generate SHA512 | |
public static String generateSHA512(String inputString) throws Exception { | |
String strHex = DigestUtils.sha512Hex(inputString); | |
return strHex; | |
} | |
// Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import crypto-js library | |
var sha512 = require('crypto-js/sha512'); | |
/** | |
* Function for generate sha512 string | |
* @param {string} inputString: text need to generate | |
* @returns {string} | |
*/ | |
function generateSHA512(inputString) { | |
let hashText = sha512(inputString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import library | |
import "crypto/sha256" | |
// Function to generate SHA256 | |
func generateSHA256(inputString string) string { | |
bData := []byte(inputString) | |
bHex := sha256.Sum256(bData) | |
strHex := hex.EncodeToString(bHex[:]) | |
return strHex | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import Apache Codec Common | |
import org.apache.commons.codec.digest.DigestUtils; | |
// Function to generate SHA256 | |
public static String generateSHA256(String inputString) throws Exception { | |
String strHex = DigestUtils.sha256Hex(inputString); | |
return strHex; | |
} | |
// Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import crypto-js library | |
var sha256 = require('crypto-js/sha256'); | |
/** | |
* Function for generate sha256 string | |
* @param {string} inputString: text need to generate | |
* @returns {string} | |
*/ | |
function generateSHA256(inputString) { | |
let hashText = sha256(inputString); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "crypto/sha1" | |
func generateSHA1(inputString string) string { | |
bData := []byte(inputString) | |
bHex := sha1.Sum(bData) | |
strHex := hex.EncodeToString(bHex[:]) | |
return strHex | |
} | |
func main() { |
NewerOlder