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

  • Home
  • SEARCH
  • 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 6349207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:34:12+00:00 2026-05-24T21:34:12+00:00

I am learning programming abstract data types. Trying to build custom hash table based

  • 0

I am learning programming abstract data types. Trying to build custom hash table based dict.

SO far I’ve created a class place holder.

    public class HashMapDict implements IDict
{
    private var _map:Array;
    public function HashMapDict()
    {
        _map = new Array();

        //TODO: implement function
    }

    public function set(keys:Array):Boolean
    {
        // 1. For each key in array of keys
        // 2. Pass Key.key to hash function
        // 3. Write Key to _map[hash(Key.key)]
        return true;
    }


}

I see the main method set doing the following

// 1. For each key in array of keys
// 2. Pass Key.key to hash function
// 3. Write Key to _map[hash(Key.key)]

What I am thinking about is to use cryptography libs for hash generation. But I am a bit confused with how it should work. e.g. Tried to look on several libs like as3crypto (http://crypto.hurlant.com/demo/) and it seems to produce hash in a way I don’t really think can be used for indexes in arrays.

E.g.

http://screencast.com/t/bE1lYQEqp4D

Can you advise which lib can I use to generate usable hashes? and how should they look like

  • 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-05-24T21:34:12+00:00Added an answer on May 24, 2026 at 9:34 pm

    For implementation of a hash table, a cryptographic hash function is overkill.

    Use this only if you are concerned with an attack of someone who tries to feed you bad data (e.g. keys with lots of hash collisions) to make the hash table slow.

    For a hash table use, a hash function like the following one is enough (pseudocode, as I don’t know the right syntax):

    hash = 0
    for c in string:
       hash = hash * 13 + c;
    return hash   
    

    But as other answers said, there is already a hash table built in, and you don’t really need to reimplement it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning programming and I've wanted to make some basic data structures. I tried
I started learning programming 4 months ago. So far I already know some javascript(and
I'm learning Sockets programming in Java. I'm trying to solve a problem that consists
I'm learning functional programming, and have tried to solve a couple problems in a
I'm learning iPhone programming from Erica Sadun's The iPhone Developer's Cookbook. When I run
I'm learning socket programming (in python) and I was wondering what the best/typical way
I am learning parallel programming by myself. I wonder if distributed memory is always
I am still learning socket programming (using Perl) but I have both options (
I'm just now learning to programming at age 17. It's hard for me to
As I continue my quest of learning functional programming, I've come to wonder if

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.