Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    启动阶段应用自启动时从/dev/random设备中获取随机数阻塞时间长

    V Series
    2
    2
    806
    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.
    • newcastle
      newcastle LV 6 last edited by

      使用的V851S,内核启动40多秒之后random才初始化完成,如果应用需要从/dev/random设备中获取随机数,需要阻塞几十秒的时间才能成功获取到随机数。

      downloadFileByUrl.png

      1 Reply Last reply Reply Quote Share 0
      • livpo
        livpo LV 6 last edited by

        对于随机数要求不高的应用,可以选择从/dev/urandom设备获取随机数来避免该问题,因为它在熵源不足时会使用伪随机数算法来生成数据,不会出现阻塞现场。

        缺点:获取的是伪随机数,随机性差

        1 Reply Last reply Reply Quote Share 0
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策