# Fix typo in Pcg.zig's fill function · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a5cc5f7854b87f3daaff790deb6dec72b329f432)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a5cc5f7854b87f3daaff790deb6dec72b329f432

Requested commit: a5cc5f7854b87f3daaff790deb6dec72b329f432

Commit: a5cc5f7854b87f3daaff790deb6dec72b329f432

Tree: 475397b776402bbe3f2e405be0add7b10b393bfc

Author: Matthew Borkowski

Committer: Isaac Freund

## Message

```
Fix typo in Pcg.zig's fill function

When filling the last (len % 4) bytes of a buffer, the random number n was only being shifted right by 4 bits for each byte instead of 8. A random u16, for example, would always have its middle two nybbles be equal when generated this way. For comparison, Isaac64.zig, Sfc64.zig, and Xoroshiro128.zig all correctly shift right by 8 bits for each of the last bytes in their nearly identical fill functions.
```

## Parents

- [175adc0bd738c2e3a55bb71c6a53dcc920c203ba](https://git.cafe/gitcafe/zig/commit/175adc0bd738c2e3a55bb71c6a53dcc920c203ba?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a5cc5f7854b87f3daaff790deb6dec72b329f432?format=markdown)
