hashlen

Crates.iohashlen
lib.rshashlen
version0.1.2
created_at2025-08-15 21:04:17.137517+00
updated_at2025-09-02 06:53:37.009854+00
descriptionhashlen
homepagehttps://github.com/i18n-site/rust/tree/dev/hashlen
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1797528
size21,784
i18n.site (i18nsite)

documentation

README

hashlen

#![feature(doc_auto_cfg)]
#![feature(doc_cfg)]

pub fn hashlen(input: impl AsRef<[u8]>) -> Vec<u8> {
  let input = input.as_ref();
  if input.len() < 17 {
    return input.to_vec();
  }

  [
    &gxhash::gxhash128(input, 0).to_le_bytes()[..],
    &intbin::to_bin(input.len())[..],
  ]
  .concat()
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Commit count: 68

cargo fmt