Skip to content
View vkcz's full-sized avatar

Block or report vkcz

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
vkcz/README.md

Hi there 👋

The following JS function provides the sum of the letters in some text (a = 1, b = 2, ... z = 26):

lettersum = t => t.toLowerCase().split("").filter(s => s.match(/[a-z]/)).map(l => l.codePointAt(0) - 96).reduce((a, b) => a + b);

This one computes be mod m:

modpow = (b, e, m) => {
    let r = 1;
    while (e > 0) {
        r = (r * b) % m;
        e--;
    }
    return r;
};

The following, using those functions, with my preferred name and surname in place of "text", outputs 1141:

const s = lettersum("text");
console.log(modpow(s, s, 8191));

Popular repositories Loading

  1. quadtree_img quadtree_img Public

    A quadtree-based image compression system and reference implementation

    Rust 2

  2. tsurch tsurch Public

    A Rust CLI tool for searching the web

    Rust

  3. zig-cairo zig-cairo Public

    Forked from jackdbd/zig-cairo

    wrapper for cairo

    Zig

  4. sstoy sstoy Public

    Forked from suiginsoft/sstoy

    Simple ShaderToy for X Windows & OpenGL ES 2.0

    C

  5. vkcz vkcz Public

  6. mdprocess mdprocess Public

    Heavily customisable browser-based Markdown renderer

    JavaScript