Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
perim
libdicey
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
libdicey
/
dmath.cpp
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
43 lines (42 loc) · 990 Bytes
main
Breadcrumbs
libdicey
/
dmath.cpp
Copy path
Top
File metadata and controls
Code
Blame
43 lines (42 loc) · 990 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "dmath.h"
#include <assert.h>
// Magic numbers from https://users.ece.cmu.edu/~koopman/lfsr/
uint32_t lfsr_tap(uint32_t size)
{
switch (size)
{
case 2: return 0x3;
case 3: return 0x6;
case 4: return 0xC;
case 5: return 0x14;
case 6: return 0x30;
case 7: return 0x60;
case 8: return 0xB4;
case 9: return 0x110;
case 10: return 0x240;
case 11: return 0x500;
case 12: return 0xE08;
case 13: return 0x1C80;
case 14: return 0x3802;
case 15: return 0x6000;
case 16: return 0xB400;
case 17: return 0x10004;
case 18: return 0x20013;
case 19: return 0x40013;
case 20: return 0x80004;
case 21: return 0x100002;
case 22: return 0x200001;
case 23: return 0x400010;
case 24: return 0x80000D;
case 25: return 0x1000004;
case 26: return 0x2000023;
case 27: return 0x4000013;
case 28: return 0x8000004;
case 29: return 0x10000002;
case 30: return 0x20000029;
case 31: return 0x40000004;
case 32: return 0x80000057;
default: assert(false); break;
}
return 0;
}
You can’t perform that action at this time.