Loading ...
Sorry, an error occurred while loading the content.
 

Re: adding sha256({string}) function

Expand Messages
  • tyru
    ... yes. if exists( *sha256 ) returns true, those functions just call it native Vim function. it should become faster a lot. (btw, webapi.vim and gist s author
    Message 1 of 8 , Jan 8, 2013
      On Tue, Jan 8, 2013 at 10:19 PM, Ingo Karkat <swdev@...> wrote:
      > On 08-Jan-13 21:58:49 +0900, tyru wrote:
      >
      >> Hi list.
      >>
      >> Here is a patch to add sha256({string}) function,
      >> which returns SHA256 checksum of {string}.
      >>
      >> To be honest, I don't know this patch is useful.
      >> because I've never had a time to use SHA256 checksum in my vim plugins.
      >> but adding sha256() function is quite easy
      >> because SHA256 implementation (sha256.c) already exists in Vim source code.
      >> so I suggest to add this function and we can use it from vimscript.
      >
      > FWIW, Yukihiro Nakadaira's webapi library (used by his popular gist plugin)
      > implements SHA1 in Vimscript. It might profit from this native Vim function...

      yes.
      if exists('*sha256') returns true, those functions just call it native
      Vim function.
      it should become faster a lot.

      (btw, webapi.vim and gist's author is Yasuhiro Matsumoto(mattn), not
      Yukihiro Nakadaira(ynkdir))

      >
      > -- regards, ingo
      >
      > --
      > You received this message from the "vim_dev" maillist.
      > Do not top-post! Type your reply below the text you are replying to.
      > For more information, visit http://www.vim.org/maillist.php

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... Thanks. I ll add a note in the todo list. Please also update the documentation. And a simple test would be good too. -- Women marry men hoping they will
      Message 2 of 8 , Jan 8, 2013
        Tyru wrote:

        > Here is a patch to add sha256({string}) function,
        > which returns SHA256 checksum of {string}.
        >
        > To be honest, I don't know this patch is useful.
        > because I've never had a time to use SHA256 checksum in my vim plugins.
        > but adding sha256() function is quite easy
        > because SHA256 implementation (sha256.c) already exists in Vim source code.
        > so I suggest to add this function and we can use it from vimscript.

        Thanks. I'll add a note in the todo list.

        Please also update the documentation. And a simple test would be good
        too.

        --
        "Women marry men hoping they will change. Men marry women hoping
        they will not. So each is inevitably disappointed."
        - Einstein

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • h_east
        Hi Bram and Tyru! ... I wrote a test. Please check this. (This patch includes only test code.) Best Regards, Hirohito Higashi -- -- You received this message
        Message 3 of 8 , Feb 2, 2013
          Hi Bram and Tyru!

          2013/1/9(Wed) 5:24:42 UTC+9 Bram Moolenaar:
          > Tyru wrote:
          >
          >
          >
          > > Here is a patch to add sha256({string}) function,
          >
          > > which returns SHA256 checksum of {string}.
          >
          > >
          >
          > > To be honest, I don't know this patch is useful.
          >
          > > because I've never had a time to use SHA256 checksum in my vim plugins.
          >
          > > but adding sha256() function is quite easy
          >
          > > because SHA256 implementation (sha256.c) already exists in Vim source code.
          >
          > > so I suggest to add this function and we can use it from vimscript.
          >
          >
          >
          > Thanks. I'll add a note in the todo list.
          >
          >
          >
          > Please also update the documentation. And a simple test would be good
          >
          > too.

          I wrote a test.
          Please check this.
          (This patch includes only test code.)

          Best Regards,
          Hirohito Higashi

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • tyru
          ... Thanks for a test. and sorry for not replying to this thread for a long time... The test works fine in my environment. ... -- -- You received this message
          Message 4 of 8 , Feb 2, 2013
            On Sat, Feb 2, 2013 at 9:36 PM, h_east <h.east.727@...> wrote:
            > Hi Bram and Tyru!
            >
            > 2013/1/9(Wed) 5:24:42 UTC+9 Bram Moolenaar:
            >> Tyru wrote:
            >>
            >>
            >>
            >> > Here is a patch to add sha256({string}) function,
            >>
            >> > which returns SHA256 checksum of {string}.
            >>
            >> >
            >>
            >> > To be honest, I don't know this patch is useful.
            >>
            >> > because I've never had a time to use SHA256 checksum in my vim plugins.
            >>
            >> > but adding sha256() function is quite easy
            >>
            >> > because SHA256 implementation (sha256.c) already exists in Vim source code.
            >>
            >> > so I suggest to add this function and we can use it from vimscript.
            >>
            >>
            >>
            >> Thanks. I'll add a note in the todo list.
            >>
            >>
            >>
            >> Please also update the documentation. And a simple test would be good
            >>
            >> too.
            >
            > I wrote a test.
            > Please check this.
            > (This patch includes only test code.)

            Thanks for a test.
            and sorry for not replying to this thread for a long time...

            The test works fine in my environment.

            >
            > Best Regards,
            > Hirohito Higashi

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Bram Moolenaar
            ... Thanks! -- Vi beats Emacs to death, and then again! http://linuxtoday.com/stories/5764.html /// Bram Moolenaar -- Bram@Moolenaar.net --
            Message 5 of 8 , Feb 3, 2013
              Hirohito Higashi wrote:

              > Hi Bram and Tyru!
              >
              > 2013/1/9(Wed) 5:24:42 UTC+9 Bram Moolenaar:
              > > Tyru wrote:
              > >
              > >
              > >
              > > > Here is a patch to add sha256({string}) function,
              > >
              > > > which returns SHA256 checksum of {string}.
              > >
              > > >
              > >
              > > > To be honest, I don't know this patch is useful.
              > >
              > > > because I've never had a time to use SHA256 checksum in my vim plugins.
              > >
              > > > but adding sha256() function is quite easy
              > >
              > > > because SHA256 implementation (sha256.c) already exists in Vim source code.
              > >
              > > > so I suggest to add this function and we can use it from vimscript.
              > >
              > >
              > >
              > > Thanks. I'll add a note in the todo list.
              > >
              > >
              > >
              > > Please also update the documentation. And a simple test would be good
              > >
              > > too.
              >
              > I wrote a test.
              > Please check this.
              > (This patch includes only test code.)

              Thanks!


              --
              Vi beats Emacs to death, and then again!
              http://linuxtoday.com/stories/5764.html

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • tyru
              ... Oops, just now I found I have not sent a help patch... Attached a complete patch of help, source code, test(by h_east) . ... -- -- You received this
              Message 6 of 8 , Feb 5, 2013
                On Sun, Feb 3, 2013 at 9:48 PM, Bram Moolenaar <Bram@...> wrote:
                >
                > Hirohito Higashi wrote:
                >
                >> Hi Bram and Tyru!
                >>
                >> 2013/1/9(Wed) 5:24:42 UTC+9 Bram Moolenaar:
                >> > Tyru wrote:
                >> >
                >> >
                >> >
                >> > > Here is a patch to add sha256({string}) function,
                >> >
                >> > > which returns SHA256 checksum of {string}.
                >> >
                >> > >
                >> >
                >> > > To be honest, I don't know this patch is useful.
                >> >
                >> > > because I've never had a time to use SHA256 checksum in my vim plugins.
                >> >
                >> > > but adding sha256() function is quite easy
                >> >
                >> > > because SHA256 implementation (sha256.c) already exists in Vim source code.
                >> >
                >> > > so I suggest to add this function and we can use it from vimscript.
                >> >
                >> >
                >> >
                >> > Thanks. I'll add a note in the todo list.
                >> >
                >> >
                >> >
                >> > Please also update the documentation. And a simple test would be good
                >> >
                >> > too.
                >>
                >> I wrote a test.
                >> Please check this.
                >> (This patch includes only test code.)
                >
                > Thanks!

                Oops, just now I found I have not sent a help patch...
                Attached a complete patch of help, source code, test(by h_east) .

                >
                >
                > --
                > Vi beats Emacs to death, and then again!
                > http://linuxtoday.com/stories/5764.html
                >
                > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                > \\\ an exciting new programming language -- http://www.Zimbu.org ///
                > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.