"Sputnik" help  
Sputnik Help
BinarySha1(<binary>)

Description

The BinarySha1 function is used to calculate the SHA-1 hash of a binary string. SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function that produces a 160-bit (20-byte) hash value. The function takes the binary string as input and returns the SHA-1 hash as a binary string.

Parameters

<binary> The binary string for which the SHA-1 hash is to be calculated.

Return Value

Success: Returns the SHA-1 hash of the input binary string as a binary string.
Failure: Returns empty string.

Remarks

The SHA-1 hash is a fixed-length binary string of 20 bytes.
SHA-1 is widely used for data integrity checks and digital signatures. However, it is no longer considered secure for cryptographic applications due to vulnerabilities in its collision resistance.
It is recommended to use stronger hash functions like SHA-256 or SHA-3 for cryptographic purposes.

Related

BinaryMd5, BinarySha256, BinarySha384, BinarySha512, BinarySha3

Example

Example of usage:

my $bin = (Binary)"Hello World!";
say BinarySha1($bin);
// PRINTS
// 2EF7BDE608CE5404E97D5F042F95F89F1C232871

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org