lpil/youid

Warnings about truncated bit array segments when building for javascript target

Open

#16 创建于 2026年5月12日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Gleam (6 fork)github user discovery
bughelp wanted

仓库指标

Star
 (31 star)
PR 合并指标
 (PR 指标待抓取)

描述

warning: Truncated bit array segment
    ┌─ /home/liv/source/gleam/gleeps/gleeps_shared/build/packages/youid/src/youid/uuid.gleam:246:64
    │
246 │   let assert <<a:size(48), _:size(4), b:size(12), _:size(2), c:size(62)>> =
    │                                                                ^^^^^^^^

This segment is a 62-bit long int, but on the JavaScript target numbers
have at most 52 bits. It would be truncated to its first 52 bits.

Hint: Did you mean to use the `bytes` segment option?

warning: Truncated bit array segment
    ┌─ /home/liv/source/gleam/gleeps/gleeps_shared/build/packages/youid/src/youid/uuid.gleam:280:26
    │
280 │   let assert <<data:bits-size(128), _:32>> = crypto.hash(crypto.Sha1, data)
    │                          ^^^^^^^^^

This segment is a 128-bit long int, but on the JavaScript target numbers
have at most 52 bits. It would be truncated to its first 52 bits.

Hint: Did you mean to use the `bytes` segment option?

warning: Truncated bit array segment
    ┌─ /home/liv/source/gleam/gleeps/gleeps_shared/build/packages/youid/src/youid/uuid.gleam:299:30
    │
299 │   let assert <<a:size(12), b:size(62), _:size(6)>> =
    │                              ^^^^^^^^

This segment is a 62-bit long int, but on the JavaScript target numbers
have at most 52 bits. It would be truncated to its first 52 bits.

Hint: Did you mean to use the `bytes` segment option?

warning: Truncated bit array segment
    ┌─ /home/liv/source/gleam/gleeps/gleeps_shared/build/packages/youid/src/youid/uuid.gleam:357:18
    │
357 │   let assert <<t:60>> = <<t_hi:12, t_mid:16, t_low:32>>
    │                  ^^

This segment is a 60-bit long int, but on the JavaScript target numbers
have at most 52 bits. It would be truncated to its first 52 bits.

Hint: Did you mean to use the `bytes` segment option?

贡献者指南