Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Files : Input/Output functions > hash

hash

get checksum of file or string using various digest algorithms

Syntax

res = hash(fd, algorithm)
res = hash(string, algorithm)

Arguments

res

hash result (a string)

fd

a matrix of file descriptors returned by the function mopen.

string

a string or a matrix of strings

algorithm

a string (the hashing algorithm)

Description

hash get the checksum of a file or a string using the hashing function algorithm. The available functions are:

'crc32'crc32 chechsum
'md5'Message-Digest Algorithm 5
'sha1'Secure Hash Algorithm 1 (160 bits)
'sha2', 'sha256'Secure Hash Algorithm 2 (256 bits)
'sha3-224'Secure Hash Algorithm 3 (224 bits)
'sha3-256'Secure Hash Algorithm 3 (256 bits)
'sha3-384'Secure Hash Algorithm 3 (384 bits)
'sha3-512'Secure Hash Algorithm 3 (512 bits)

Examples

hash('hello world', 'md5')
hash('hello world', 'sha256')
hash(['hello';'world'], 'sha3-256')

fp = mopen(SCI+'/modules/core/etc/core.start')
hash(fp ,'sha256')
mclose(fp)

History

バージョン記述
6.1.1 hash() introduced.
Report an issue
<< getURL Files : Input/Output functions %io >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:37:52 CET 2022