Skip to content

About

Checksum-neutral IPv6-to-IPv6 Network Prefix Translation (NPTv6) calculator

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPTv6 Calculator

A static, dependency-free calculator for checksum-neutral IPv6-to-IPv6 Network Prefix Translation (RFC 6296).

Enter the internal source address with its prefix length (e.g. fd01:203:405:1::1234/48, /1–/64) and the external prefix, and it returns the translated address with the adjusted 16-bit word, so TCP/UDP checksums stay valid without being recalculated.

  • /48 or shorter: bits 48–63 (the subnet word) are adjusted (RFC 6296 §3.2).
  • /49–/64: the first interface-identifier word that is not 0xFFFF is adjusted (§3.5).

Project layout

index.html          Markup only
css/styles.css      Styles (light + dark mode)
js/nptv6.js         Pure NPTv6 / IPv6 logic (no DOM), unit tested
js/app.js           UI wiring (form handling, rendering)
tests/              Node test suite (node:test)
.nojekyll           Tells GitHub Pages to serve files as-is

Run locally

ES modules don't load from file://, so serve the folder over HTTP:

npm start            # python3 -m http.server 8000
# open http://localhost:8000

Test

npm test             # requires Node 18+

Deploy to GitHub Pages

  1. Push this folder to the root of a GitHub repository.
  2. Go to Settings → Pages.
  3. Under Build and deployment, set Source to Deploy from a branch, pick main and / (root), then save.
  4. The site will be live at https://<user>.github.io/<repo>/ within a minute or two.

All asset paths are relative, so it works from a project subpath without changes.

About

Checksum-neutral IPv6-to-IPv6 Network Prefix Translation (NPTv6) calculator

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages