EgretDoc
Back to Home
Location:system/crypto.sha1

Module

Module documentation.

modulecrypto.sha1

Classes

Classes and inheritance.

Functions

Free functions and class methods.

functioncrypto.sha1::byte
Signaturefunc byte(n: Int) -> String
func byte(n: Int) -> String {
    return encoding.byte_from_code(n & 255);
}
@briefProvides the system library operation `byte`.
@detailsExecutes the `byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functioncrypto.sha1::byte_at
Signaturefunc byte_at(s: String, idx: Int) -> Int
func byte_at(s: String, idx: Int) -> Int {
    return std.byte_at(s, idx) & 255;
}
@briefProvides the system library operation `byte_at`.
@detailsExecutes the `byte_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • idxZero-based index.
@returnReturns the operation result as `Int`.
functioncrypto.sha1::u32_be
Signaturefunc u32_be(n: Int) -> String
func u32_be(n: Int) -> String {
    return byte((n >> 24) & 255)
    + byte((n >> 16) & 255)
@briefProvides the system library operation `u32_be`.
@detailsExecutes the `u32_be` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functioncrypto.sha1::mask32
Signaturefunc mask32(n: Int) -> Int
func mask32(n: Int) -> Int {
    return n & 4294967295;
}
@briefProvides the system library operation `mask32`.
@detailsExecutes the `mask32` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `Int`.
functioncrypto.sha1::rol32
Signaturefunc rol32(n: Int, bits: Int) -> Int
func rol32(n: Int, bits: Int) -> Int {
    let x: Int = mask32(n);
    return mask32((x << bits) | (x >> (32 - bits)));
@briefProvides the system library operation `rol32`.
@detailsExecutes the `rol32` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
  • bitsBit count, bit mask, or encoded bits consumed by the operation.
@returnReturns the operation result as `Int`.
functioncrypto.sha1::pad
Signaturefunc pad(data: String) -> String
func pad(data: String) -> String {
    let bit_len: Int = std.len(data) * 8;
    let out: String = data + byte(128);
@briefProvides the system library operation `pad`.
@detailsExecutes the `pad` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • dataInput or output data buffer.
@returnReturns the operation result as `String`.
functioncrypto.sha1::word
Signaturefunc word(block: String, off: Int) -> Int
func word(block: String, off: Int) -> Int {
    return (byte_at(block, off) << 24)
    | (byte_at(block, off + 1) << 16)
@briefProvides the system library operation `word`.
@detailsExecutes the `word` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • blockBlock size, callback block, or blocking-mode flag used by the operation.
  • offZero-based byte offset or element offset at which the operation starts.
@returnReturns the operation result as `Int`.
functioncrypto.sha1::sum
Signaturefunc sum(data: String) -> String
func sum(data: String) -> String {
    let msg: String = pad(data);
    let state_a: Int = 1732584193;
@briefProvides the system library operation `sum`.
@detailsExecutes the `sum` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • dataInput or output data buffer.
@returnReturns the operation result as `String`.

Variables

Class fields (var).