Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:04:11+00:00 2026-06-08T09:04:11+00:00

Working on a project, I have this issue where my array slicetable returns undefined

  • 0

Working on a project, I have this issue where my array “slicetable” returns undefined every time, and I do not know how to solve this problem. I have a function that generates an array of likelihoods for cryptographic key lengths – I then need to split the text into individual strings of n-th keys, up to the length of the “key”. I’ve worked for the last 4 hours on this problem, and don’t know where to begin. If anyone could recommend a good strategy for tackling problems like this, as well as helping me out on this one, that would be great – I’m still quite new to all of this.

function vigenerekey(text, max) {
    // Standardize the text
    text = text.split(" ").join("").toUpperCase();
    // Obtain our list of key length probabilities
    var probabilities = vigenerekeylength(text, max);
    // Extend the Math.max to arrays
    Array.max = function(array){
        return Math.max.apply(Math, array);
    };

    // Find the position of the most probable key length
    for (var d = 0; d <=12; d++) {
        if (probabilities[d] === probabilities.max) {
            return;
        }
    }
    // Slice the text into [d] parts (the length of the key)
    var slicetable = ['','','','','','','','','','','','','','','','','','','','',''];
    var chiresults = [];
    for (var e = 0; e <= d; e++){
        for (f = 0; f <= text.length; f++) {
            if (f % e === 0) {
                slicetable[e] += text.charAt(f);        
            }
        }
    return slicetable;
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:04:13+00:00Added an answer on June 8, 2026 at 9:04 am

    Don’t you mean this: (break instead of return)

    // Find the position of the most probable key length 
    for (var d = 0; d <=12; d++) { 
        if (probabilities[d] === probabilities.max) { 
            break;
        } 
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on this project and I have to open a new browser tab.
So I have been working on this project for a short while now. I
I'm working on this surface project where we have a bing maps control and
I am working on online pdf library project. In this I have a feature
I have an audio project I'm working on using BASS from Un4seen. This library
I working on project and have problem with threading and update of UI. I
I have been working on rails project, which had been made using noSql(Mongoid). Every
I have a working project that Im amending, it crashes after trying to use
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
I am working on project where I have the checkInternet method in one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.