import { createHash } from "crypto";
import { readFileSync } from "fs";
export function sha256(query: string): string {
return createHash("sha256").update(query, "utf8").digest("hex");
}
class FeatureFlag < ApplicationRecord
validates :key, presence: true, uniqueness: true
validates :percentage,
numericality: { only_integer: true,
greater_than_or_equal_to: 0,
less_than_or_equal_to: 100 }
use std::collections::HashMap;
use std::path::PathBuf;
use walkdir::WalkDir;
pub fn group_by_size(root: &str) -> HashMap<u64, Vec<PathBuf>> {
use crate::hashing::double_hash;
pub struct BloomFilter {
bits: Vec<u64>,
m: usize, // number of bits
k: u32, // number of hash probes
package mailer
import (
"crypto/sha256"
"encoding/hex"
"strings"
CREATE TABLE password_reset_tokens (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
token_hash TEXT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,
used_at TIMESTAMPTZ,
mod chunker;mod parallel_hash;
use parallel_hash::{hash_buffer, root_hash};
const CHUNK_SIZE: usize = 64 * 1024;