server Namespace Ape.sha1

Summary

File
<./src/Ape_Server/modules/libape-spidermonkey.c>

sha1 Namespace Detail

Ape.sha1
Namespace for SHA1 encoding and dedoding.
File:
<./src/Ape_Server/modules/libape-spidermonkey.c>

Summary

Own
Methods Attributes Methods Name Methods Description
<static>   Ape.sha1. bin (text, secret) Encode a string using sha1 algorithm as binary.
<static>   Ape.sha1. str (text, secret) Encode a string using sha1 algorithm.

<static> {string} Ape.sha1. bin (text, secret)

Encode a string using sha1 algorithm as binary.

You can specify the secret key has second argument. The result is returned has raw binary.

Parameters:
{String} text A string.
{String} secret Optional The secret key to use.
Returns:
{string} The sha1 digest string in raw binary format
Example
var result = Ape.sha1.bin("hello world");
See:
Ape.sha.str

<static> {string} Ape.sha1. str (text, secret)

Encode a string using sha1 algorithm.

You can specify the secret key has second argument.

Parameters:
{String} text A string.
{String} secret Optional The secret key to use.
Returns:
{string} The sha1 digest
Example
var result = Ape.sha1.str("hello world");
//result = 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
var result = Ape.sha1.str("hello world", "mysecretkey");
//result = 529a42c50c09857dbe9a5891d6b453d543aaf434
See:
Ape.sha.bin