Oihana PHP Arango

sha256.php

Table of Contents

Functions

sha256()  : string
Calculate the SHA256 checksum for text and return it in hexadecimal format.

Functions

sha256()

Calculate the SHA256 checksum for text and return it in hexadecimal format.

sha256(string $value) : string

This helper wraps the ArangoDB AQL function SHA256(text) which calculates the SHA256 checksum for the given text and returns it as a hexadecimal string. SHA256 is a cryptographic hash function producing a 256-bit hash.

Example AQL usage:

SHA256("hello")               // returns "2cf24dba4fb601a80065e1c3b8b5c9e8b8b5c9e8b8b5c9e8b8b5c9e8b8b5c9e8"
SHA256("world")               // returns "486ea46224d1bb4fb680f34f7c9ad96a8f24ec88be73ea8e5a6c65260e9cb8a7"
SHA256(doc.content)           // returns SHA256 hash of content
Parameters
$value : string

String expression to calculate SHA256 hash for.

Tags
example
use function oihana\arango\db\functions\strings\sha256;

$expr = sha256('doc.content');
// Produces: 'SHA256(doc.content)'
see
https://docs.arangodb.com/stable/aql/functions/string/#sha256
sha1()

For SHA1 hash.

sha512()

For SHA512 hash.

md5()

For MD5 hash.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results