Fosi Fossil Service
Small teams. Open source. Built on Fossil.

IaC / SwiftFlow

High-performance WMS with wave picking, smart routing, and real-time inventory visibility.

Public | Owner: IaC | Default branch: trunk | Last update: 2026-10-23 14:37

Artifact 69e626c63b88fbb4fa1c2e29b6bb9f21ce01d6e71226d66fd3f6be8376fa773d:


-module(swiftflow_crypto_ffi).
-export([random_hex/1, sha256_hex/1, pbkdf2_sha256_hex/3, secure_equals/2]).

random_hex(Bytes) when is_integer(Bytes), Bytes > 0 ->
    binary:encode_hex(crypto:strong_rand_bytes(Bytes), lowercase).

sha256_hex(Data) when is_binary(Data) ->
    binary:encode_hex(crypto:hash(sha256, Data), lowercase).

pbkdf2_sha256_hex(Password, Salt, Iterations)
  when is_binary(Password), is_binary(Salt), is_integer(Iterations), Iterations > 0 ->
    binary:encode_hex(crypto:pbkdf2_hmac(sha256, Password, Salt, Iterations, 32), lowercase).

secure_equals(A, B) when is_binary(A), is_binary(B), byte_size(A) =:= byte_size(B) ->
    crypto:hash_equals(A, B);
secure_equals(_, _) ->
    false.

Clone

You can clone this repository with the following command:

fossil clone https://fosi.dev/IaC/SwiftFlow

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.