lpil/youid

Warnings about truncated bit array segments when building for javascript target

Open

#16 aberto em 12 de mai. de 2026

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Gleam (6 forks)github user discovery
bughelp wanted

Métricas do repositório

Stars
 (31 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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?

Guia do colaborador