Skip to content

Commit

Permalink
Unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Dec 29, 2024
1 parent 687037d commit 4efc05e
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions util/ia.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,10 @@ import {retry} from './util.mjs';

const regSha256 = /^[\da-f]{64}$/i;

export function groupForSha256(sha256) {
return `shockpkg_packages_${sha256[0]}`;
}

export function pathForFile(sha256, file) {
const a = sha256.slice(0, 2);
const b = sha256.slice(2, 4);
const c = sha256.slice(4);
return `${a}/${b}/${c}/${file}`;
}

export function groupPath(sha256, file) {
return `${sha256}/${file}`;
}

export function createPackageUrl(sha256, file) {
const f = encodeURIComponent(file);
const g = groupForSha256(sha256);
return `https://archive.org/download/${g}/${pathForFile(sha256, f)}`;
}

export function createFileUrl(group, file) {
const f = file.split('/').map(encodeURIComponent).join('/');
const b = encodeURIComponent(group);
Expand Down

0 comments on commit 4efc05e

Please sign in to comment.