sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Md5 hash or similar in SU Ruby?

    Scheduled Pinned Locked Moved Developers' Forum
    10 Posts 4 Posters 1.6k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thomthomT Offline
      thomthom
      last edited by

      I'm trying to find a hashing method similar to md5 in SU Ruby, but haven't found any.
      Is there none?

      Anyone got any suggestions?

      It's for generating unique IDs.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • tbdT Offline
        tbd
        last edited by

        maybe start with http://betterexplained.com/articles/the-quick-guide-to-guids/

        also TIG said sometime ago about using Time.now + random

        SketchUp Ruby Consultant | Podium 1.x developer
        http://plugins.ro

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          I was thinking of using a timestamp + entityID. And I thought I'd try to hash it.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            That GUID article looks like it will do the trick.

            cheers!

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Anyone has some info on what hashing method Ruby's String.hash uses?

              I'm looking at using this: "#{e.entityID}#{Time.now.to_i}".hash - but I'm not sure if I should just skip the .hash bit.

              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                There is a md5.so in the digest library. Don't know what Ruby digests are used for. (The CHM has no info.)

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • Dan RathbunD Offline
                  Dan Rathbun
                  last edited by

                  There was a link on the GUID article to a add-on Ruby UUID generator library.

                  http://raa.ruby-lang.org/project/uuid/
                  and th rubyforge page:
                  http://rubyforge.org/projects/reliable-msg/

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    Yea, I looked at that article. It seemed to require a few modules that doesn't ship with SU.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      Ricounet
                      last edited by

                      Hello!

                      I know this post is really old.
                      But for reference purposes, I found a pure Ruby implementation of MD5 there:
                      http://d.hatena.ne.jp/zakinco/20091030/p1

                      Just copy the Purerubymd5 module in your script or a library file.
                      Purerubymd5.hexdigest("abc")
                      is then available from Sketchup Ruby.

                      1 Reply Last reply Reply Quote 0
                      • Dan RathbunD Offline
                        Dan Rathbun
                        last edited by

                        Personally I have just used a Ruby %x call using the fciv.exe command line checksum utility that I believe came with the Windows Support Tools.

                        fciv stands for File Checksum Integrity Verifier:
                        Microsoft Download: File Checksum Integrity Verifier

                        💭

                        I'm not here much anymore.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement