Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
liujinxia
@liujinxia
Member
NO. 23543 / 2015-11-17

5 Topics / 15 Replies
0 Followers
0 Following
11 Favorites
GitHub Public Repos
  • nlp 0

  • switch-examples 0

    Switch examples for devkitA64 and libnx.

  • git 0

    Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into p...

  • phpunit 0

    The PHP Unit Testing framework.

  • php-code-coverage 0

    Library that provides collection, processing, and rendering functionality for PHP code coverage i...

  • xxl-job 0

    A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)

  • linux-source-code-analyze 0

    Linux源码分析

  • 3y 0

    :notebook:从Java基础、JavaWeb基础到常用的框架再到面试题都有完整的教程,几乎涵盖了Java后端必备的知识点

  • swagger-php 0

    A php swagger annotation and parsing library

  • blog 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 怎么查找一段代码在项目中其他的位置? at October 08, 2016

    rubymine ctrl+shift+f 😊 😊 😊

  • libgit2 是如何绑定到其他语言的 at October 02, 2016

    #5 楼 @flowerwrong

    😀 就是这个,我想要的,谢谢。😆

  • libgit2 是如何绑定到其他语言的 at October 02, 2016

    http://tenderlovemaking.com/2009/12/18/writing-ruby-c-extensions-part-1.html 好像明白了一点,多谢@nouse

  • libgit2 是如何绑定到其他语言的 at October 02, 2016

    #1 楼 @malayke https://ruby-china.org/topics/30146 就是这篇,libgit2 的 API https://libgit2.github.com/libgit2/#HEAD rugged 的 github 托管地址: https://github.com/libgit2/rugged/tree/master/lib/rugged

    我就不明白他们怎么联系上的

  • GitLab 发送邮件失效,使用 ActionMailer 和 postfix at September 22, 2016

    @jasi 原来不会走 postfix 了,虽然不确切的知道为什么,但是给我排查问题带来很大的帮助,谢谢😊 。 目前找到的问题是跟网络有关的,好多外网地址 ping 不通。

  • Ruby 方法传递实例变量的问题 at May 04, 2016

    原来如此,谢谢各位

  • 通过「刻意练习」,你才能成为顶尖的程序员 at January 05, 2016

    恩,那三个圈的理论很赞,学习区是最有收获的

  • 如何彻底删除一个 controller 里的 action at January 05, 2016

    谢谢大家。确实是需要了解功能后手动删除,然后测试一下。

  • 如何彻底删除一个 controller 里的 action at January 04, 2016

    以前用的是搜这个 action 函数名的方法,但是要删的地方实在太多了,函数个数也比较多,有没有什么好的方法呢?

  • Ruby 解密 AES at January 04, 2016
    require 'openssl'
    class Test3
    
      def aes_encrypt(key, encrypted_string)
        aes = OpenSSL::Cipher::Cipher.new("AES-256-CBC")
        aes.encrypt
        aes.key = key
        aes.iv = '0000000000000000'
        aes.padding =0 
    
    
        length = 16
        count = encrypted_string.length
        if count < length
            add = (length-count)
            encrypted_string = encrypted_string + ("\0" * add)
        else if count > length
            add = (length-(count % length))
            encrypted_string = encrypted_string + ("\0" * add)
             end
        end
        puts "encrypted_string=#{encrypted_string}" 
        txt = aes.update(encrypted_string)+aes.final
        puts "txt=:#{txt}"
        txt.unpack('H*')[0]
      end
    
    
      def aes_dicrypt(key, dicrypted_string)
        aes = OpenSSL::Cipher::Cipher.new("AES-256-CBC")
        aes.decrypt
        aes.key = key
        aes.iv = '0000000000000000'
        aes.padding = 0
        aes.update([dicrypted_string].pack('H*')) << aes.final
      end
    
      test = Test3.new
      key = "双方的秘钥"
      sec = test.aes_encrypt(key,'1111111111111111')
      puts sec
    
      txt = test.aes_dicrypt(key, sec)
      puts txt
    
    end
    
    
  • 关于 redirect_to 重定向的同时传参数 at December 08, 2015

    嗯,按照 9 楼的方法可以传值过去

  • Ruby 解密 AES at December 02, 2015

    嗯,解决啦,用了一楼的方法,借鉴了三楼和六楼的代码。😄大家给力👍🏼👍🏼👏🏻

  • Ruby 解密 AES at December 02, 2015

    @tumayun 我也用了这个方法,但是跟 python 加密的结果不一样,那个 update 方法能详细讲讲码? ^^^

  • Ruby 解密 AES at December 01, 2015

    我觉得是编码出了问题,因为关于 AES 的所有能配的都配了,key 我没有写真实的,实际用的 key 长度是没问题的。 python 那个解密只调用 cryptor.decrypt(a2b_hex(text)),这个方法先把十六进制的 text 转化成了二进制,然后解码。 这个方法和 ruby 用的 [token_encry].pack('H*') 得到的二进制码一样,但是解出的码不一样,ruby 解出了乱码

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English